package com.qkl.common.publics.web.controller;

import com.qkl.common.publics.service.WXInfoService;
import com.qkl.common.publics.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("{public.baseURL}")
@Slf4j
public class WXInfoController {

    @Autowired
    private WXInfoService wxInfoService;


    /**
     * 获取微信access token
     * @return
     */
    @GetMapping("/getAccessToken")
    public Result getAccessToken() {
        return ControllerHelper.toOperateResult(wxInfoService.getAccessToken());
    }

    /**
     * 刷新微信access token
     * @return
     */
    @GetMapping("/refreshAccessToken")
    public Result refreshAccessToken() {
        return ControllerHelper.toOperateResult(wxInfoService.refreshAccessToken());
    }

}
